package br.com.gbvbahia.mybooks.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.Toast;
import br.com.gbvbahia.mybooks.Avaliar;
import br.com.gbvbahia.mybooks.Cadastro;
import br.com.gbvbahia.mybooks.Perfil;
import br.com.gbvbahia.mybooks.Pesquisar;
import br.com.gbvbahia.mybooks.Prateleiras;
import br.com.gbvbahia.mybooks.R;
import br.com.gbvbahia.mybooks.service.ws.WebService;

public class ButtonsFragment extends FragmentMae {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.frag_buttons, null);
		
		Button btnCadastro = (Button) view
				.findViewById(R.id.btnPrincipalCadastro);

		Button btnPesquisar = (Button) view
				.findViewById(R.id.btnPrincipalPesquisar);

		Button btnAvaliar = (Button) view
				.findViewById(R.id.btnPrincipalAvaliar);

		Button btnPrateleiras = (Button) view
				.findViewById(R.id.btnPrincipalPrateleiras);

		Button btnPerfil = (Button) view.findViewById(R.id.btnPrincipalPerfil);

		btnCadastro.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(), Cadastro.class));
			}
		});

		btnPesquisar.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(), Pesquisar.class));
			}
		});

		btnAvaliar.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(), Avaliar.class));
			}
		});

		btnPrateleiras.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(), Prateleiras.class));
			}
		});

		btnPerfil.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(new Intent(v.getContext(), Perfil.class));
			}
		});

		return view;
	}

}
